import me.w70.bot.Bot;
import me.w70.bot.methods.Constants;
import me.w70.bot.scripting.Random;
import me.w70.bot.wrappers.RSInterface;
import me.w70.bot.wrappers.RSInterfaces;

public class CloseTele extends Random {
	@Override
	public boolean canRun() {
		final RSInterface iface = RSInterfaces.getInterface(326);
		return iface.isValid()
				&& iface.getChild(2).getText().contains("wants to teleport");
	}

	@Override
	public String getScriptAuthor() {
		return "spooky";
	}

	@Override
	public String getScriptName() {
		return "Tele(Other) Closer";
	}

	@Override
	public String getScriptCategory() {
		return "Random";
	}

	@Override
	public String getScriptDescription() {
		return "Closes teleother window";
	}

	@Override
	public int loop() {
		atInterface(RSInterfaces.getInterface(326).getChild(8));
		wait(random(500, 750));
		openTab(Constants.TAB_OPTIONS);
		wait(random(500, 750));
		Bot.addMessage(this, "Disabling accept aid");
		clickMouse(random(569, 603), random(415, 440), false);
		return -1;
	}
}